<template>
	<div class="main">
		<div class="form-container">
			<div  class="form-main">
				<div class="enter_title">
					<h2 style="background:#265eff;">企业复工信息上报</h2>
				</div>
				<div class="name">
					<span class="required" style="color:red">*</span>
					<label for="name">姓名</label><br/>
					<input class="form-border" id="name" type="text" name="username" maxlength="20" placeholder="姓名" required="required" v-model="name"  /> <br/>
				</div>
				<div class="enterpriseName">
					<span class="required" style="color:red">*</span>
					<label for="enterpriseName">所属单位</label><br/>
					<input class="form-border" id="enterpriseName" type="text" name="enterpriseName" maxlength="20" placeholder="所属单位" required="required" v-model.number="enterpriseName"  /> <br/>
				</div>
				<div class="employeeCode">
					<span class="required" style="color:red">*</span>
					<label for="employeeCode">人员编号</label><br/>
					<input class="form-border" id="employeeCode" type="text" name="employeeCode" maxlength="20" placeholder="人员编号" required="required" v-model="employeeCode"  /> <br/>
				</div>
				<div class="idNumber">
					<span class="required" style="color:red">*</span>
					<label for="idNumber">身份证号</label><br/>
					<input class="form-border" id="idNumber" type="text" name="idNumber" @blur="checkIDNumber" maxlength="18" placeholder="请填写身份证号"  v-model="idNumber"  /> <br/>
				</div>
				<div class="sex">
					<span class="required" style="color:red">*</span>
					<label for="gender" required>性别</label><br/>
					<div class="form-border form-twoBor">
						<div style="border: 1px solid #c6c8c9; border-radius:3px;">
							<el-radio-group v-model="sex">
								<el-radio :label="0">男</el-radio>
								<div></div>
								<el-radio :label="1">女</el-radio>
							</el-radio-group>
						</div>
					</div>
				</div>
				<div class="deptment">
					<span class="required" style="color:red">*</span>
					<label for="deptment">所在一级部门</label><br/>
					<input class="form-border" id="deptment" type="text" name="deptment" maxlength="20" placeholder="所在一级部门" required="required" v-model="deptmentName"  /> <br/>
				</div>
				<span class="required" style="color:red">*</span>
				<label for="job" required>工作岗位</label><br/>
				<div class="form-border form-twoBor">
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="job" label="0">正式合同制</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
						<el-radio v-model="job" label="1">临时聘用</el-radio>
					</div>
				</div>
				<div class="phoneNum">
					<span class="required" style="color:red">*</span>
					<label for="phone">联系电话</label><br/>
					<input class="form-border" id="phone" type="text" name="phoneNum" maxlength="12" placeholder="请填写联系电话" v-model="phone" /><br/>
				</div>
				<div class="residence">
					<span class="required" style="color:red">*</span>
					<label for="residence">固定居住地址</label><br/>
					<input class="form-border" id="residence" type="text" readonly @click="showSelectPopup=true" name="residence"  placeholder="请填写固定居住地址" v-model="residence"  /> <br/>
				</div>
				<div class="yy-c currentProvince">
					<span class="required" style="color:red">*</span>
					<label for="currentProvince">您所在的小区</label>
					<input class="form-border" id="currentProvince" maxlength="32" type="text" name="currentProvince"   placeholder="小区"  v-model="community"  /> <br/>
				</div>
				<div class="yy-city-distance">
					<div class="yy-c currentCity" >
						<span class="required" style="color:red">*</span>
						<label for="currentCity">楼号</label>
						<input class="form-border" id="currentCity" maxlength="10" type="text" name="currentCity"  placeholder="楼号"  v-model="building"  /> <br/>
					</div>
					<div class="yy-c yy-ccurrentCounty" >
						<span class="required" style="color:red">*</span>
						<label for="currentCounty">单元</label>
						<input class="form-border" id="currentCounty" maxlength="10" type="text" name="currentCounty"  placeholder="单元"  v-model="unit"  /> <br/>
					</div>
					<div class="yy-c yy-ccurrentCounty">
						<span class="required" style="color:red">*</span>
						<label for="roomNumber">房间号</label>
						<input class="form-border" id="roomNumber" maxlength="10" type="text" name="roomNumber"  placeholder="房间号"  v-model="roomNumber"  /> <br/>
					</div>
				</div>
				<span class="required" style="color:red">*</span>
				<label for="dutyStatus" required>在岗状态</label><br/>
				<div class="form-border form-twoBor">
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="dutyStatus" label="1">远程在岗</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
						<el-radio v-model="dutyStatus" label="2">现场在岗</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
						<el-radio v-model="dutyStatus" label="3">离岗</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
						<el-radio v-model="dutyStatus" label="4">出差</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
						<el-radio v-model="dutyStatus" label="5">休假</el-radio>
					</div>
				</div>
				<div class="query-time">
					<label for="name">预计返岗日期</label><br/>
					<div style="margin-top: 10px;margin-bottom: 20px; width:100%; height: 32px; line-height:32px; border: 1px solid #cccccc; text-align: center; " @click="postDateShow=true" >
						<span class="select_show">{{postDate}}</span>
					</div>
					<span @click="postDate=''" v-if="postDate" style="position: absolute;right: 0;top: 31px;margin-right: 10px;padding: 0 10px;font-size: 18px;line-height: 1.7;">x</span>
					<datetime style="display:none;" v-model="postDate" @on-change="changeTime" :show.sync="postDateShow"></datetime>
				</div>
				<span class="required" style="color:red">*</span>
				<label for="leave" required>近期是否离开固定驻地</label><br/>
				<div class="form-border form-twoBor">
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="leaveHabitation" @change="leaveDate='';toCity='';back='';" label="0">否</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
						<el-radio v-model="leaveHabitation" label="1">是</el-radio>
					</div>
				</div>
				<div class="query-time" v-if="leaveHabitation==1">
					<label for="name">离开固定驻地时间</label><br/>
					<div style="margin-top: 10px;margin-bottom: 20px; width:100%; height: 32px; line-height:32px; border: 1px solid #cccccc; text-align: center; " @click="leaveDateShow=true">
						<span class="select_show">{{leaveDate}}</span>
					</div>
					<span @click="leaveDate=''" v-if="leaveDate" style="position: absolute;right: 0;top: 31px;margin-right: 10px;padding: 0 10px;font-size: 18px;line-height: 1.7;">x</span>
					<datetime style="display:none;" v-model="leaveDate" @on-change="changeTime" :show.sync="leaveDateShow"></datetime>
				</div>
				<div class="toCity" v-if="leaveHabitation==1">
					<span class="required" style="color:red">*</span>
					<label for="toCity">所赴城市</label><br/>
					<input class="form-border" id="toCity" @click="openCityShow('toCity')" readonly type="text" name="toCity" maxlength="20" placeholder="所赴城市" required="required" v-model="toCity"  /> <br/>
				</div>
				<div v-if="leaveHabitation==1">
					<span class="required" style="color:red">*</span>
					<label for="back" required>是否已返回</label><br/>
					<div class="form-border form-twoBor">
						<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
							<el-radio v-model="back" label="0">否</el-radio>
						</div>
						<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
							<el-radio v-model="back" label="1">是</el-radio>
						</div>
					</div>
				</div>
				<div class="currentCityName">
					<span class="required" style="color:red">*</span>
					<label for="currentCityName">目前所在城市</label><br/>
					<input class="form-border" id="currentCityName" type="text"  @click="openCityShow('currentCityName')" readonly name="currentCityName" maxlength="20" placeholder="目前所在城市" required="required" v-model="currentCityName"  /> <br/>
				</div>
				<div class="query-time">
					<label for="backDate">返回时间</label><br/>
					<div style="margin-top: 10px;margin-bottom: 20px; width:100%; height: 32px; line-height:32px; border: 1px solid #cccccc; text-align: center; " @click="backDateshow=true">
						<span class="select_show">{{backDate}}</span>
					</div>
					<span @click="backDate=''" v-if="backDate" style="position: absolute;right: 0;top: 31px;margin-right: 10px;padding: 0 10px;font-size: 18px;line-height: 1.7;">x</span>
					<datetime style="display:none;" v-model="backDate" @on-change="changeTime" :show.sync="backDateshow"></datetime>
				</div>

				<span class="required" style="color:red">*</span>
				<label for="vehicle" required>离开与返回的交通工具</label><br/>
				<div class="form-border form-twoBor">
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="vehicle" label="火车"></el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="vehicle" label="高铁"></el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="vehicle" label="飞机"></el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="vehicle" label="自驾"></el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="vehicle" label="汽车"></el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="vehicle" label="船只"></el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="vehicle" label="摩托车"></el-radio>
					</div>

				</div>
				<!-- <div class="yy-c beenHubei">
					<span class="required" style="color:red">*</span>
					<label for="beenHubei">1月1日以后是否去过湖北</label>
					<input class="form-border" id="beenHubei" maxlength="32" type="text" name="beenHubei"   placeholder="请输入1月1日以后是否去过湖北"  v-model="beenHubei"  /> <br/>
				</div> -->
				<span class="required" style="color:red">*</span>
				<label for="passHubei" required>1月1日以后是否去过湖北</label><br/>
				<div class="form-border form-twoBor">
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="beenHubei" label="0">否</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
						<el-radio v-model="beenHubei" @change="beenHubeiFlag" label="1">是</el-radio>
					</div>
				</div>
				<div class="query-time" v-if="beenHubei==1">
					<label for="planBackDate">去湖北时间</label><br/>
					<div style="margin-top: 10px;margin-bottom: 20px; width:100%; height: 32px; line-height:32px; border: 1px solid #cccccc; text-align: center; " @click="beenHubeiDateShow=true">
						<span class="select_show">{{beenHubeiDate}}</span>
					</div>
					<span @click="beenHubeiDate=''" v-if="beenHubeiDate" style="position: absolute;right: 0;top: 31px;margin-right: 10px;padding: 0 10px;font-size: 18px;line-height: 1.7;">x</span>
					<datetime style="display:none;" v-model="beenHubeiDate" @on-change="changeTime" :show.sync="beenHubeiDateShow"></datetime>
				</div>
				<div class="query-time" v-if="beenHubei==1">
					<label for="planBackDate">离开湖北时间</label><br/>
					<div style="margin-top: 10px;margin-bottom: 20px; width:100%; height: 32px; line-height:32px; border: 1px solid #cccccc; text-align: center; " @click="leaveHubeiDateShow=true">
						<span class="select_show">{{leaveHubeiDate}}</span>
					</div>
					<span @click="leaveHubeiDate=''" v-if="leaveHubeiDate" style="position: absolute;right: 0;top: 31px;margin-right: 10px;padding: 0 10px;font-size: 18px;line-height: 1.7;">x</span>
					<datetime style="display:none;" v-model="leaveHubeiDate" @on-change="changeTime" :show.sync="leaveHubeiDateShow"></datetime>
				</div>
				<span class="required" style="color:red">*</span>
				<label for="passHubei" required>是否经停湖北</label><br/>
				<div class="form-border form-twoBor">
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="passHubei" label="0">否</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
						<el-radio v-model="passHubei" label="1">是</el-radio>
					</div>
				</div>
				<div class="query-time">
					<label for="planBackDate">计划返回时间</label><br/>
					<div style="margin-top: 10px;margin-bottom: 20px; width:100%; height: 32px; line-height:32px; border: 1px solid #cccccc; text-align: center; " @click="planBackDateShow=true">
						<span class="select_show">{{planBackDate}}</span>
					</div>
					<span @click="planBackDate=''" v-if="planBackDate" style="position: absolute;right: 0;top: 31px;margin-right: 10px;padding: 0 10px;font-size: 18px;line-height: 1.7;">x</span>

					<datetime style="display:none;" v-model="planBackDate" @on-change="changeTime" :show.sync="planBackDateShow"></datetime>
				</div>
				<span class="required" style="color:red">*</span>
				<label for="touchHubei" required>离开期间是否与湖北地区的人员接触</label><br/>
				<div class="form-border form-twoBor">
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="touchHubei" label="0">否</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
						<el-radio v-model="touchHubei" label="1">是</el-radio>
					</div>
				</div>
				<span class="required" style="color:red">*</span>
				<label for="gender" required>14日内是否接触过武汉来人</label><br/>
				<div class="form-border form-twoBor">
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="fourteenDayTouchWuhan" label="0">否</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
						<el-radio v-model="fourteenDayTouchWuhan" label="1">是</el-radio>
					</div>
				</div>
				<span class="required" style="color:red">*</span>
				<label for="gender" required>14日内是否接触过湖北来人</label><br/>
				<div class="form-border form-twoBor">
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="fourteenDayTouchHubei" label="0">否</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
						<el-radio v-model="fourteenDayTouchHubei" label="1">是</el-radio>
					</div>
				</div>

				<span class="required" style="color:red">*</span>
				<label for="gender" required>是否发热（体温>37.3℃）</label><br/>
				<div class="form-border form-twoBor">
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="fever" label="0">否</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
						<el-radio v-model="fever" label="1">是</el-radio>
					</div>
				</div>
				<label for="gender" required>其他症状</label><br/>
				<div class="form-border tizheng clearfix">
					<div>
						<el-checkbox  v-model="symptom" label="乏力"></el-checkbox>
					</div>
					<div>
						<el-checkbox  v-model="symptom" label="干咳"></el-checkbox>
					</div>
					<div>
						<el-checkbox  v-model="symptom" label="肌肉酸痛"></el-checkbox>
					</div>
					<div>
						<el-checkbox  v-model="symptom" label="寒战"></el-checkbox>
					</div>
					<div>
						<el-checkbox  v-model="symptom" label="呼吸困难"></el-checkbox>
					</div>
					<div>
						<el-checkbox  v-model="symptom" label="咽痛"></el-checkbox>
					</div>
					<div>
						<el-checkbox  v-model="symptom" label="头疼"></el-checkbox>
					</div>
					<div>
						<el-checkbox  v-model="symptom" label="眩晕"></el-checkbox>
					</div>
					<div>
						<el-checkbox  v-model="symptom" label="腹痛"></el-checkbox>
					</div>
					<div>
						<el-checkbox  v-model="symptom" label="腹泻"></el-checkbox>
					</div>
					<div>
						<el-checkbox  v-model="symptom" label="恶心"></el-checkbox>
					</div>
					<div>
						<el-checkbox  v-model="symptom" label="呕吐"></el-checkbox>
					</div>
					<div>
						<el-checkbox  v-model="symptom" label="鼻塞"></el-checkbox>
					</div>
				</div>
				<label for="gender" required>一起返回的家属</label><br/>
				<div class="form-border tizheng clearfix">
					<div>
						<el-checkbox  v-model="backTogether" label="父母"></el-checkbox>
					</div>
					<div>
						<el-checkbox  v-model="backTogether" label="子女"></el-checkbox>
					</div>
					<div>
						<el-checkbox  v-model="backTogether" label="配偶"></el-checkbox>
					</div>
					<div>
						<el-checkbox  v-model="backTogether" label="亲属"></el-checkbox>
					</div>
				</div>

				<span class="required" style="color:red">*</span>
				<label for="gender" required>家属身体状况</label><br/>
				<div class="form-border form-twoBor">
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="familySymptom" label="0">正常</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
						<el-radio v-model="familySymptom" label="1">异常</el-radio>
					</div>
				</div>
				<span class="required" style="color:red">*</span>
				<label for="gender" required>是否向所在社区居委会登记报到</label><br/>
				<div class="form-border form-twoBor">
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="reportCommittee" label="1">是</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
						<el-radio v-model="reportCommittee" label="0">否</el-radio>
					</div>
				</div>
				<span class="required" style="color:red">*</span>
				<label for="gender" required>外地返回是否做自我居家隔离14天</label><br/>
				<div class="form-border form-twoBor">
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="fourteenDayIsolation" label="1">居家隔离完成</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-bottom:none; border-radius: 3px;" >
						<el-radio v-model="fourteenDayIsolation" label="2">隔离中</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
						<el-radio v-model="fourteenDayIsolation" label="3">未隔离</el-radio>
					</div>
				</div>
				<label>其他需要报告的情况</label><br/>
				<div class="form-border form-twoBor">
					<div class="textAreaBox" style="border-bottom: 1px solid rgba(255, 255, 255, 0.24);">
						<textarea name="clueCon" id="" maxlength="255"
									v-model="remark" placeholder=""></textarea>
						<!-- <span>{{remnant}}/255</span> -->
					</div>
				</div>

				<label for="gender" required>人群类型</label><br/>
				<div class="form-border form-twoBor">
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5;border-bottom: none; border-radius: 3px;" >
						<el-radio v-model="personnelType" label="3">正常</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-bottom: none; border-raduis: 3px;" >
						<el-radio v-model="personnelType" label="0">确诊</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5;border-bottom: none; border-radius: 3px;" >
						<el-radio v-model="personnelType" label="1">疑似</el-radio>
					</div>
					<div style="border: 1px solid #c6c8c9; border-top-color:#e5e5e5; border-radius: 3px;" >
						<el-radio v-model="personnelType" label="2">密接</el-radio>
					</div>

				</div>

				<div class="query-time">
					<label for="planBackDate">解决隔离时间</label><br/>
					<div style="margin-top: 10px;margin-bottom: 20px; width:100%; height: 32px; line-height:32px; border: 1px solid #cccccc; text-align: center; " @click="relieveDateShow=true">
						<span class="select_show">{{relieveDate}}</span>
					</div>
					<span @click="relieveDate=''" v-if="relieveDate" style="position: absolute;right: 0;top: 31px;margin-right: 10px;padding: 0 10px;font-size: 18px;line-height: 1.7;">x</span>
					<datetime style="display:none;" v-model="relieveDate" @on-change="changeTime" :show.sync="relieveDateShow"></datetime>
				</div>

				<div class="yy-c trainNumber">
					<label for="vehicle">车次或航班号</label>
					<input class="form-border" id="trainNumber" maxlength="32" type="text" name="trainNumber"   placeholder="请输入车次或航班号"  v-model="trainNumber"  /> <br/>
				</div>
				<div class="yy-c ">
					<label for="vehicle">接触武汉人信息</label>
					<input class="form-border"  maxlength="32" type="text"    placeholder="请输入接触武汉人信息"  v-model="peopleWuhan"  /> <br/>
				</div>
				<div class="yy-c ">
					<label for="peopleHubei">接触湖北人信息</label>
					<input class="form-border"  maxlength="32" type="text"    placeholder="请输入接触湖北人信息"  v-model="peopleHubei"  /> <br/>
				</div>

			</div>
			<button v-if="countdownFlag" class="form-submit" type="submit" @click="submitClick">提交</button>
			<button v-else  class="form-submiTime" type="submit">请在{{countdown}}秒后继续上报</button>
		</div>
		<!-- <datetime style="display:none;" v-model="queryTime" @on-change="changeTime" :show.sync="timeShow"></datetime> -->
		<!-- <confirm v-model="showconfirm"
			:title="confirmtitle"
			@on-cancel="onCancel"
			@on-confirm="onConfirm"
			@on-show="onShow"
			@on-hide="onHide">
		</confirm> -->
		<popup v-model="showSelectPopup"   height="50%">
			<menuLinkage :queryObj="casList" @setCityObj="setCityObj" ref="menuLinkage" />
		</popup>
		<popup v-model="showSelectCityPopup"  height="50%">
			<menuLinkage :queryObj="casListCity" @setCityObj="setCityObjTwo" ref="menuLinkageTwo" />
		</popup>
	</div>
</template>
<script>
import { requestEnterpriseData ,queryCityData,queryCityDataForTwo} from '@/assets/js/service'
import fromConfig from '../../../static/formConfig'
import { Confirm , Datetime,PopupPicker,Popup} from 'vux'
import menuLinkage from '../commons/menuLinkage.vue'

export default {
    components: {
        Confirm,
        Datetime,
        PopupPicker,
        Popup,
        menuLinkage
    },
    data () {
        return {
			casList:[],
			casModel:[],
			casListCity:[],
			showSelectPopup:false,//是否显示级联组件
			showSelectCityPopup:false,//显示城市组件
			flagCity:"",//标识当前选中城市赋值
			backDateshow:false,
			leaveDateShow:false,
			postDateShow:false,
			planBackDateShow:false,
			relieveDateShow:false,
			beenHubeiDateShow:false,
			leaveHubeiDateShow:false,
			// 表单字段
			name:'',//姓名
			enterpriseName:'',//所属单位
			enterpriseCode:'',//单位编码
			employeeCode:'',//人员编号
			idNumber:'',//身份证号
			sex:'',//性别
			deptmentName:'',//所在一级部门
			job:'0',//工作岗位
			phone:'',//联系电话

			vehicle:"",//离开与返回的交通工具
			beenHubei:"",//1月1日以后是否去过湖北

			address:'',//固定居住地址（城市、区县、街道、社区、小区、楼栋、单元、楼层、房间号）
			residence:'',//
			community:'',//您所在的小区
			communityCode:'',//小区编码
			building:'',//楼号
			unit:'',//单元
			roomNumber:'',//房间号

			currentProvince:'',//当前所在省
			currentCity:'',//市（当前所在地）
			currentCounty:'',//区/县
			currentCountry:'',//街道/乡/镇
			currentVillage:'',//社区/村
			 //新增
            currentProvinceCode:'',//当前所在省 code
            currentCityCode:'',//当前所在市 code
            currentCountyCode:'',//当前所在区/县 code
            currentCountryCode:'',//街道/乡/镇（当前所在地）code
            currentVillageCode:'',////社区/村（当前所在地）code
            communityCode:'',//小区code

			dutyStatus:'1',//在岗状态(1远程在岗、2现场在岗，3离岗，4出差，5休假）
			postDate:'',//预计返岗日期
			leaveHabitation:'0',//近期是否离开固定驻地（1是、0否）
			leaveDate:'',//离开固定驻地时间
			toCity:'',//所赴城市
			back:'0',//是否已返回（1是、0否）
			currentCityName:'',//目前所在城市
			backDate:'',//返回时间
			passHubei:'0',//是否经停湖北（1是,0否）
			planBackDate:'',//计划返回时间
			touchHubei:'0',//离开期间是否与湖北地区的人员接触
			fourteenDayTouchWuhan:'0',//14日内是否接触过武汉来人（1是,0否）
			fourteenDayTouchHubei:'0',//14日内是否接触过湖北来人（1是,0否）
			fever:'0',//是否发热（>=37.3度）（1是,0否）
			symptom:[],//其它症状
			backTogether:[],//一起返回的家属（父母、爱人、孩子、孙子女、亲属）
			familySymptom:'0',//家属身体状况（0正常，1异常）
			reportCommittee:'0',//是否向所在社区居委会登记报到（1是,0否）
			fourteenDayIsolation:'1',//外地返回是否做自我居家隔离14天（1居家隔离完成、2隔离中、3未隔离）
			remark:'',//其他需要报告的情况

			personnelType:"3",//人群类型（0:确诊，1:疑似，2:密接）
			relieveDate:"",//解决隔离时间
			trainNumber:"",//车次或航班号
			beenHubeiDate:"",//去湖北时间
			leaveHubeiDate:"",//离开湖北时间
			peopleWuhan:"",//接触武汉人信息
			peopleHubei:"",//接触湖北人信息

            countdown:"5",//倒计时
            countdownFlag:true,
            info:{
				commuityCode:'',//小区编码
				commuityName:'',//小区名称
				regionalismCode:'',//行政区划code
				responsible:'',//责任人
				responsiblePhone:'',//责任人电话
            }
        }
    },
    created () {
		// commuityCode=小区编码&commuityName=小区名称&regionalismCode=行政区划code &responsible=责任人&responsiblePhone=责任人电话
		this.info=this.$route.query;
		console.log(this.info)
		this.community=this.info.commuityName;//小区名称
		this.communityCode=this.info.commuityCode;//小区编码
		// this.regionalismCode=this.info.regionalismCode;//行政区划code
		// this.responsible=this.info.responsible;//责任人
		// this.responsiblePhone=this.info.responsiblePhone;//责任人电话

		this.initcascade();
    },
    mounted: function () {

    },
    watch:{
		name(){　　
			var regu = "^[a-zA-Z\u4e00-\u9fa5]+$";
			var re = new RegExp(regu);
			if (this.nameModel.search(re) != -1){
				return true;
			} else {
				window.vm.$vux.toast.text('姓名填写有误', 'center')
				return false;
			}
        },
        idNumber(){
			let pattern = /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/
			let date = new Date()
			if(this.idNumber.length > 17){
				debugger
				if(!pattern.test(this.idNumber)) {
					window.vm.$vux.toast.text('证件号填写有误', 'center')
				} else {
					var num = this.idNumber.charAt(16);
					console.log("fff=>"+num);
					if(num%2==0){
						// console.log('女');
						this.sex = 1
						this.isChecked = true;
					}else{
						this.sex = 0
						this.isChecked = true;
					}
				}

			}
        },
    },
    methods: {
		beenHubeiFlag(){
			if(this.beenHubei==1){
				this.leaveHubeiDate='';
				this.beenHubeiDate='';
				console.log('1'+this.leaveHubeiDate)
			}
			console.log('2'+this.leaveHubeiDate)


		},
        submitClick(){
            let _this = this;
			let param={
				name:this.name,//姓名
				enterpriseName:this.enterpriseName,//所属单位（企事业单位、高校、科研院所等名称）
				enterpriseCode:this.enterpriseCode,//单位编码
				employeeCode:this.employeeCode,//人员编号
				idNumber:this.idNumber,
				sex:this.sex,
				deptmentName:this.deptmentName,//所在一级部门（院系、所室等）
				job:this.job,//工作岗位（正式合同制、临时聘用）
				phone:this.phone,//联系电话-必填
				address:this.residence+"/"+this.community+"/"+this.unit+"/"+this.roomNumber,//
				dutyStatus:this.dutyStatus,//在岗状态（1远程在岗、2现场在岗，3离岗，4出差，5休假）
				postDate:this.postDate,//预计返岗日期
				leaveDate:this.leaveDate,//离开固定驻地时间
				leaveHabitation:this.leaveHabitation,//近期是否离开固定驻地
				toCity:this.toCity,//所赴城市
				back:this.back,//是否已返回
				currentCityName:this.currentCity,//目前所在城市,
				backDate:this.backDate,//返回时间
				vehicle:this.vehicle,//离开与返回的交通工具
				beenHubei:this.beenHubei,//1月1日以后是否去过湖北,
				passHubei:this.passHubei,//是否经停湖北
				planBackDate:this.planBackDate,//计划返回时间
				touchHubei:this.touchHubei,//离开期间是否与湖北地区的人员接触
				fourteenDayTouchWuhan:this.fourteenDayTouchWuhan,//14日内是否接触过武汉来人（1是,0否）
				fourteenDayTouchHubei:this.fourteenDayTouchHubei,//14日内是否接触过湖北来人（1是,0否）
				fever:this.fever,//是否发热（>=37.3度）（1是,0否）
				symptom:this.symptom.join(","),//其它症状
				backTogether:this.backTogether.join(","),//一起返回的家属
				familySymptom:this.familySymptom,//家属身体状况（0正常，1异常）
				reportCommittee:this.reportCommittee,//是否向所在社区居委会登记报到（1是,0否）
				fourteenDayIsolation:this.fourteenDayIsolation,//外地返回是否做自我居家隔离14天
				remark:this.remark,//其他需要报告的情况,
				currentProvince:this.currentProvinceCode,//
				currentCity:this.currentCityCode,
				currentCounty:this.currentCountyCode,
				currentCountry:this.currentCountryCode,
				currentVillage:this.currentVillageCode,
				commuityCode:this.communityCode,
				community:this.community,//小区（详细地址）
				building:this.building,//楼栋
				unit:this.unit,//单元
				roomNumber:this.roomNumber,
				personnelType:this.personnelType,
				relieveDate:this.relieveDate,
				trainNumber:this.trainNumber,
				beenHubeiDate:this.beenHubeiDate,
				leaveHubeiDate:this.leaveHubeiDate,
				peopleHubei:this.peopleWuhan,
				peopleWuhan:this.peopleWuhan,
			}
			if(_this.$verification(this.name,0,"姓名")&&_this.$verification(this.idNumber,0,"身体证号")&&_this.$verification(this.deptmentName,0,"所在一级部门")
			&&_this.$verification(this.job,0,"工作岗位")&&_this.$verification(this.phone,0,"联系电话")
			&&_this.$verification(this.currentProvinceCode,0,"固定居住地址")&&_this.$verification(this.dutyStatus,0,"在岗状态")){
				console.log(param)
				let beenHubeiDate = this.beenHubeiDate.replace("/-/g", "/");
				let leaveHubeiDate = this.leaveHubeiDate.replace("/-/g", "/");
				if(beenHubeiDate > leaveHubeiDate) {
					console.log('到时间大于离开时间')
					_this.$showBottomToast("到湖北时间大于离开湖北时间，请重新选择")
				} else {
					requestEnterpriseData(param,(res)=>{
						console.log("return==>",res);
						if(res.success){
							_this.countdownFlag=false;
							var timeId =setInterval(() => {
								_this.countdown--
								console.log('1')
								if(_this.countdown==0){
									_this.countdownFlag=true;
									_this.countdown=5;
									clearInterval(timeId)
								}
							},1000)
							_this.$showBottomToast("上报成功")
						}else{
							_this.$showBottomToast("上报失败")
						}
					})
				}
			}
		},
		changeTime(){

		},
		openCityShow(flag){
			this.flagCity=flag;
			this.showSelectCityPopup=true;

		},
        initcascade(){
            let _this=this;
            queryCityData({"parentCode":"000000"},function(res){
                // console.log("resaaaaaaaaaaaaaaaaaaaa==>",res)
                _this.casList=[];
                if(typeof(res.data)!="undefined"&&res.data.length>0){
                    _this.casList=res.data;
                    _this.$refs.menuLinkage.initData(_this.casList,1);
                    _this.$refs.menuLinkage.setDefault(['湖北省','武汉市','江夏区'])
                }
			})
			//初始化行政区划二级
            queryCityDataForTwo({},function(res){
                console.log("res==>",res)
                _this.casListCity=[];
                if(typeof(res.data)!="undefined"&&res.data.length>0){
                    _this.casListCity=res.data;
                    _this.$refs.menuLinkageTwo.initData(_this.casListCity,0);
                }
            })
		},
		setCityObj(_list){
            if(typeof(_list[0])!='undefined'){
                this.currentProvince=_list[0].name;
				this.currentProvinceCode=_list[0].code;
				this.residence=_list[0].name;
            }
            if(typeof(_list[1])!='undefined'){
                this.currentCity=_list[1].name;
				this.currentCityCode=_list[1].code;
				this.residence=this.residence+"/"+_list[1].name;
            }
            if(typeof(_list[2])!='undefined'){
                this.currentCounty=_list[2].name;
				this.currentCountyCode=_list[2].code;
				this.residence=this.residence+"/"+_list[2].name;
            }
            if(typeof(_list[3])!='undefined'){
                this.currentCountry=_list[3].name;
				this.currentCountryCode=_list[3].code;
				this.residence=this.residence+"/"+_list[3].name;
            }else{
                this.currentCountry="";
            }
            if(typeof(_list[4]) !='undefined'){
              this.currentVillage = _list[4].name;
			  this.currentVillageCode = _list[4].code;
			  this.residence=this.residence+"/"+_list[4].name;
            } else {
              this.currentVillage = '';
            }
            this.showSelectPopup=false;
		},
		setCityObjTwo(_list){
			if(this.flagCity=="toCity"){
				 if(typeof(_list[0])!='undefined'){
					this.toCity=_list[0].name;
				}
				if(typeof(_list[1])!='undefined'){
					this.toCity=this.toCity+"/"+_list[1].name;
				}
			}else if(this.flagCity=="currentCityName"){
				 if(typeof(_list[0])!='undefined'){
					this.currentCityName=_list[0].name;
				}
				if(typeof(_list[1])!='undefined'){
					this.currentCityName=this.currentCityName+"/"+_list[1].name;
				}
			}
			this.showSelectCityPopup=false;

		},
		checkIDNumber(){
          // let pattern = /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/;
          let pattern =  /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;;
          let date = new Date();
            if(!pattern.test(this.idNumber)) {
              window.vm.$vux.toast.text('证件号填写有误', 'center')
            } else{
                let ageMuis = date.getFullYear() - this.idNumber.substring(6,10);
                if(ageMuis > 0){
                  this.ageModel = ageMuis;
                } else {
                  // window.vm.$vux.toast.text('证件号填写有误', 'center')
                }
                var num = this.idNumber.charAt(16);
                // let num = this.idNumber.substring(16,18);
                console.log(num);
                if(num%2==0){
                  // console.log('女');
                  this.six = 1;
                  this.isChecked = true;
                }else{
                  this.genderModel = 0
                  this.isChecked = true;
                }
            }
        }
    }
}
</script>
<style lang="less" scoped>

.main{
    overflow: hidden;
    // background: url("../../assets/images/home/bj.png") 0 0;
    background-size: 100% 100%;
    .form-container{
        background: #f8fafb;
        border-left: 1px solid #e5e5e5;
        border: 1px solid #e5e5e5;
        background-size: 100% 100%;
        width: calc(100% -16px);
        // margin: 0 3%;
        margin-left:8px;
        margin-right:8px;
        margin-bottom: 10px;
        padding-bottom: 25px;
        border-radius: 8px;
        .name {
          	padding-top: 15px;
        }
        .form-main{
            width: 100%;
            // margin-top: 130px;
            border-radius: 5px;
            margin-bottom: 30px;
            padding: 0 20px;
			color: #333333;
			.query-time{
				position: relative;
			}
            .warn-content{
                margin-top: 10px;
                margin-bottom: 18px;
                line-height: 30px;
                font-size: 15px;
            }
            h2{
                text-align: center;
                color: #fff;
                width: calc(100% + 40px);
                margin-left: -20px;
                border-bottom: 1px solid rgba(255, 255, 255, 0.24);
                height: 60px;
                line-height: 60px;
                font-size: 24px;
            }
            h4{
                margin-top: 15px;
            }
            .form-border{
                background-color: rgba(255, 255, 255, 0.9);
                color: #333333;
                padding:5px;
                margin: 9px 0;
                width: 100%;
                margin-bottom: 20px;
                border-radius: 3px;
            }
            .tizheng{
                div{
                    width: 33.3333%;
                    float: left;
                    padding: 10px 5px;
                    font-size: 15px;
                    input{
                        vertical-align: middle;
                        width: 15px;
                        height: 15px;
                    }
                }
            }
            .form-twoBor{
                padding: 5px 0;
                div{
                    width: 100%;
                    padding: 5px 10px;
                    input{
                        vertical-align: middle;
                        width: 20px;
                        height: 20px;
                    }
                    label{
                        font-size: 15px;
                    }
                }

            }

        }
        .form-submit{
            width: 90%;
            margin-left: 5%;
            height: 50px;
            background: #228ed9;
            border-radius: 8px;
            color: white;
            font-size: 15px;
            border: none;
            outline: none;
        }
        .form-submiTime{
			width: 90%;
			margin-left: 5%;
			height: 50px;
			background: #228ed940;
			border-radius: 8px;
			color: white;
			font-size: 15px;
			border: none;
			outline: none;
        }
    }
	label{
	//  margin-bottom: 15px;
	}

	input{
		border: 1px solid #cccccc;
	}
	.el-input__inner{
		color: #fdfdfd;
	}
	.el-radio{
		margin: 5px;
		left: -5px;
		width: 100%;
		.el-radio__label{
			color: #000;
		}
		.el-radio__input.is-checked+.el-radio__label{
			color: #000 !important;
		}
		// .el-radio__input .is-checked+.el-radio__label {
		//   color: #000 !important;
		// }
	}
	.el-checkbox{
		width: 100%;
	}
	.yy-city-distance{
		display: flex;
		justify-content: center;
		align-items: center;
		.yy-c{
			display: 1;
			margin-right: 10px;
		}
	}
	#residence{
		font-size: 12px;
		height: 40px;
	}
	p {
		font-size: 15px;
		padding-left: 5px;
	}
	.textAreaBox {
		position: relative;
		height: 8em;
		padding: 0;
		z-index: 2;
		textarea {
			position: relative;
			width: 100%;
			height: 100%;
			padding: 10px;
		}
		span {
			position: absolute;
			right: 0;
			bottom: 0;
			z-index: 1;
			color: #ccc;
		}
	}
}
</style>
